﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Demo
{
	public class Database
	{
		private DataTable _Book;

		public Database()
		{
			_Book = new DataTable();

			_Book.Columns.Add("编号", typeof(int));
			_Book.Columns.Add("书名", typeof(string));
			_Book.Columns.Add("作者", typeof(string));
			_Book.Columns.Add("出版日期", typeof(DateTime));
			_Book.Columns.Add("定价", typeof(decimal));

			_Book.Rows.Add(new object[] { 0, "《王一麻子历险记》", "张灵", DateTime.Parse("2001-01-01"), 11 });
			_Book.Rows.Add(new object[] { 1, "《王二麻子历险记》", "张一", DateTime.Parse("2002-02-01"), 22 });
			_Book.Rows.Add(new object[] { 2, "《王三麻子历险记》", "张二", DateTime.Parse("2003-04-01"), 33 });
			_Book.Rows.Add(new object[] { 3, "《王四麻子历险记》", "张三", DateTime.Parse("2004-05-22"), 44 });
			_Book.Rows.Add(new object[] { 4, "《王五麻子历险记》", "张四", DateTime.Parse("2005-01-15"), 55 });
			_Book.Rows.Add(new object[] { 5, "《王六麻子历险记》", "张五", DateTime.Parse("2006-06-01"), 66 });
			_Book.Rows.Add(new object[] { 6, "《王七麻子历险记》", "张六", DateTime.Parse("2007-01-26"), 77 });
			_Book.Rows.Add(new object[] { 7, "《王八麻子历险记》", "张其", DateTime.Parse("2008-11-01"), 88 });
			_Book.Rows.Add(new object[] { 8, "《王九麻子历险记》", "张霸", DateTime.Parse("2009-01-01"), 99 });
			_Book.Rows.Add(new object[] { 9, "《王十麻子历险记》", "张酒", DateTime.Parse("2010-12-01"), 90 });
		}

		public DataTable Book
		{
			get
			{
				return _Book;
			}
		}
	}
}
